<template>
	<view class="quota-index">
		<view class="quota-card-box">
			<view class="flex-between-center">
				<view class="fw-b">可用额度 (元)</view>
				<view class="flex-align-center" @click="$common.navigator('/pagesA/order/list')">
					<view class="color-999">借还记录</view>
					<static-image src="/static/img/common/arrow-right.png" width="26" height="26" margin-left="4"></static-image>
				</view>
			</view>
			<view class="money-text">{{$common.addThousandsSeparator(info.showAmount)}}</view>
			<view class="borrowed-box flex-between-center" v-if="info.alreadyLoanAmount">
				<view class="dis-flex">
					<static-image src="/pagesA/static/img/quota/icon-money.png" width="24" height="24" margin-right="8" margin-top="4"></static-image>
					<view class="">
						<view class="font-s-12 color-666">含已借额度</view>
						<view class="font-s-16 fw-b mar-t-5">{{$common.addThousandsSeparator(info.alreadyLoanAmount)}}</view>
					</view>
				</view>
				<view class="flex-align-center" @click="toBill">
					<view class="color-999 font-s-12">查看该账单</view>
					<static-image src="/static/img/common/arrow-right.png" width="24" height="24" margin-left="4"></static-image>
				</view>
			</view>
		</view>
		<view class="flex-align-center">
			<view class="font-s-18 fw-b">提额方式</view>
			<view class="color-999 font-s-12 mar-l-8">补充信息，提升信用，提额更多</view>
		</view>
		<view class="handle-box">
			<view class="handle-item flex-between-center">
				<view class="flex-align-center">
					<static-image src="/pagesA/static/img/quota/icon-gzzm.png" width="80" height="80" margin-right="24"></static-image>
					<view class="">
						<view class="flex-align-center">
							<view class="font-s-16 fw-b">工作证明</view>
							<view class="status-tag wait-tag" v-if="info.incrWorkStatus===1">审核中</view>
							<view class="status-tag" v-if="info.incrWorkStatus===2">已提额</view>
							<view class="status-tag red-tag" v-if="info.incrWorkStatus===3">未通过</view>
						</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrWorkStatus===0">工作是证明您是否有一份稳定收入</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrWorkStatus===1">信息审核中，请耐心等待结果</view>
						<view class="color-orange font-s-12 mar-t-7" v-if="info.incrWorkStatus===2">信息审核完成，额度<text class="fw-b mar-t-5">+{{$common.addThousandsSeparator(info.incrWorkAmount)}}</text></view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrWorkStatus===3">审核未通过，请修改后重新提交</view>
					</view>
				</view>
				<template v-if="info.isClick">
					<view class="handle-btn primary-btn" @click="$common.navigator('/pagesA/quota/workCertificate')" v-if="info.incrWorkStatus===0">提升额度</view>
					<view class="handle-btn" @click="$common.navigator('/pagesA/quota/workCertificate')" v-if="[1,2].includes(info.incrWorkStatus)">查看信息</view>
					<view class="handle-btn error-btn" @click="$common.navigator('/pagesA/quota/workCertificate')" v-if="info.incrWorkStatus===3">重新提交</view>
				</template>
			</view>
			<view class="handle-item flex-between-center">
				<view class="flex-align-center">
					<static-image src="/pagesA/static/img/quota/icon-xlzm.png" width="80" height="80" margin-right="24"></static-image>
					<view class="">
						<view class="flex-align-center">
							<view class="font-s-16 fw-b">学历证明</view>
							<view class="status-tag wait-tag" v-if="info.incrEducationStatus===1">审核中</view>
							<view class="status-tag" v-if="info.incrEducationStatus===2">已提额</view>
							<view class="status-tag red-tag" v-if="info.incrEducationStatus===3">未通过</view>
						</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrEducationStatus===0">学历是证明您是否具备一定的能力</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrEducationStatus===1">信息审核中，请耐心等待结果</view>
						<view class="color-orange font-s-12 mar-t-7" v-if="info.incrEducationStatus===2">信息审核完成，额度<text class="fw-b mar-t-5">+{{$common.addThousandsSeparator(info.incrEducationAmount)}}</text></view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrEducationStatus===3">审核未通过，请修改后重新提交</view>
					</view>
				</view>
				<template v-if="info.isClick">
					<view class="handle-btn primary-btn" @click="$common.navigator('/pagesA/quota/educationCertificate')" v-if="info.incrEducationStatus===0">提升额度</view>
					<view class="handle-btn" @click="$common.navigator('/pagesA/quota/educationCertificate')" v-if="[1,2].includes(info.incrEducationStatus)">查看信息</view>
					<view class="handle-btn error-btn" @click="$common.navigator('/pagesA/quota/educationCertificate')" v-if="info.incrEducationStatus===3">重新提交</view>
				</template>
			</view>
			<view class="handle-item flex-between-center">
				<view class="flex-align-center">
					<static-image src="/pagesA/static/img/quota/icon-srzm.png" width="80" height="80" margin-right="24"></static-image>
					<view class="">
						<view class="flex-align-center">
							<view class="font-s-16 fw-b">收入证明</view>
							<view class="status-tag wait-tag" v-if="info.incrIncomeStatus===1">审核中</view>
							<view class="status-tag" v-if="info.incrIncomeStatus===2">已提额</view>
							<view class="status-tag red-tag" v-if="info.incrIncomeStatus===3">未通过</view>
						</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrIncomeStatus===0">收入是资产证明的重要补充</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrIncomeStatus===1">信息审核中，请耐心等待结果</view>
						<view class="color-orange font-s-12 mar-t-7" v-if="info.incrIncomeStatus===2">信息审核完成，额度<text class="fw-b mar-t-5">+{{$common.addThousandsSeparator(info.incrIncomeAmount)}}</text></view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrIncomeStatus===3">审核未通过，请修改后重新提交</view>
					</view>
				</view>
				<template v-if="info.isClick">
					<view class="handle-btn primary-btn" @click="$common.navigator('/pagesA/quota/incomeCertificate')" v-if="info.incrIncomeStatus===0">提升额度</view>
					<view class="handle-btn" @click="$common.navigator('/pagesA/quota/incomeCertificate')" v-if="[1,2].includes(info.incrIncomeStatus)">查看信息</view>
					<view class="handle-btn error-btn" @click="$common.navigator('/pagesA/quota/incomeCertificate')" v-if="info.incrIncomeStatus===3">重新提交</view>
				</template>
			</view>
			<view class="handle-item flex-between-center">
				<view class="flex-align-center">
					<static-image src="/pagesA/static/img/quota/icon-fcxx.png" width="80" height="80" margin-right="24"></static-image>
					<view class="">
						<view class="flex-align-center">
							<view class="font-s-16 fw-b">房产信息</view>
							<view class="status-tag wait-tag" v-if="info.incrHomeStatus===1">审核中</view>
							<view class="status-tag" v-if="info.incrHomeStatus===2">已提额</view>
							<view class="status-tag red-tag" v-if="info.incrHomeStatus===3">未通过</view>
						</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrHomeStatus===0">房产是资产证明的重要补充</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrHomeStatus===1">信息审核中，请耐心等待结果</view>
						<view class="color-orange font-s-12 mar-t-7" v-if="info.incrHomeStatus===2">信息审核完成，额度<text class="fw-b mar-t-5">+{{$common.addThousandsSeparator(info.incrHomeAmount)}}</text></view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrHomeStatus===3">审核未通过，请修改后重新提交</view>
					</view>
				</view>
				<template v-if="info.isClick">
					<view class="handle-btn primary-btn" @click="$common.navigator('/pagesA/quota/houseCertificate')" v-if="info.incrHomeStatus===0">提升额度</view>
					<view class="handle-btn" @click="$common.navigator('/pagesA/quota/houseCertificate')" v-if="[1,2].includes(info.incrHomeStatus)">查看信息</view>
					<view class="handle-btn error-btn" @click="$common.navigator('/pagesA/quota/houseCertificate')" v-if="info.incrHomeStatus===3">重新提交</view>
				</template>
			</view>
			<view class="handle-item flex-between-center">
				<view class="flex-align-center">
					<static-image src="/pagesA/static/img/quota/icon-cczm.png" width="80" height="80" margin-right="24"></static-image>
					<view class="">
						<view class="flex-align-center">
							<view class="font-s-16 fw-b">车产证明</view>
							<view class="status-tag wait-tag" v-if="info.incrCarStatus===1">审核中</view>
							<view class="status-tag" v-if="info.incrCarStatus===2">已提额</view>
							<view class="status-tag red-tag" v-if="info.incrCarStatus===3">未通过</view>
						</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrCarStatus===0">车产是资产证明的重要补充</view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrCarStatus===1">信息审核中，请耐心等待结果</view>
						<view class="color-orange font-s-12 mar-t-7" v-if="info.incrCarStatus===2">信息审核完成，额度<text class="fw-b mar-t-5">+{{$common.addThousandsSeparator(info.incrCarAmount)}}</text></view>
						<view class="color-999 font-s-12 mar-t-7" v-if="info.incrCarStatus===3">审核未通过，请修改后重新提交</view>
					</view>
				</view>
				<template v-if="info.isClick">
					<view class="handle-btn primary-btn" @click="$common.navigator('/pagesA/quota/carCertificate')" v-if="info.incrCarStatus===0">提升额度</view>
					<view class="handle-btn" @click="$common.navigator('/pagesA/quota/carCertificate')" v-if="[1,2].includes(info.incrCarStatus)">查看信息</view>
					<view class="handle-btn error-btn" @click="$common.navigator('/pagesA/quota/carCertificate')" v-if="info.incrCarStatus===3">重新提交</view>
				</template>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			}
		},
		onShow() {
			this.getDetail()
		},
		methods: {
			getDetail() {
				this.$request({
					url: '/orderInfoIncrIncome/incrIncomeDetail',
					method: 'get',
				}).then(res => {
					this.info = res.data
				})
			},
			toBill(){
				uni.switchTab({
					url:'/pages/bill/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.quota-index {
		background-image: url('../static/img/quota/newcomer-header-bg.png');
		background-size: 100% 560rpx;
		background-repeat: no-repeat;
		padding: 32rpx 24rpx;
		.quota-card-box{
			width: 702rpx;
			background: linear-gradient( 180deg, #E0F1FF 0%, #FFFFFF 160rpx);
			border: 4rpx solid #FFFFFF;
			background-color: #FFFFFF;
			border-radius: 24rpx;
			padding: 32rpx 24rpx;
			margin-bottom: 48rpx;
			.money-text{
				font-size: 72rpx;
				font-weight: bold;
				letter-spacing: 4rpx;
				margin-top: 24rpx;
			}
			.borrowed-box{
				height: 104rpx;
				background: linear-gradient( 180deg, #F0F4FA 0%, #F5F7FA 100%);
				border-radius: 16rpx;
				padding: 0 16rpx;
				margin-top: 24rpx;
			}
		}
		.handle-box{
			.handle-item{
				margin-top: 32rpx;
				width: 702rpx;
				height: 144rpx;
				background: #FFFFFF;
				border-radius: 24rpx;
				padding: 0 24rpx;
				.mar-t-7{
					margin-top: 14rpx;
				}
				.status-tag{
					width: 80rpx;
					height: 32rpx;
					line-height: 32rpx;
					background: rgba(24,204,132,0.08);
					border-radius: 4rpx;
					font-size: 24rpx;
					color: #18CC84;
					text-align: center;
					margin-left: 8rpx;
					&.wait-tag{
						background: rgba(255,133,51,0.08);
						color: #FF8533;
					}
					&.red-tag{
						background: rgba(245,56,49,0.08);
						color: #F53831;
					}
				}
				.handle-btn{
					width: 144rpx;
					height: 56rpx;
					border-radius: 28rpx;
					border: 1rpx solid #1F78FF;
					color: #1F78FF;
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 24rpx;
					&.primary-btn{
						background: linear-gradient( 270deg, #33A0FF 0%, #1F78FF 100%);
						border: 0;
						color: #FFFFFF;
					}
					&.error-btn{
						border: 1rpx solid #F53831;
						color: #F53831;
					}
				}
			}
		}
	}
</style>
